Skip to content

Conversation

@fabiorush
Copy link

Previously, destroy() would temporarily change status but the provider would continue living, firing unwanted events and causing memory leaks. The websocketClose handler would trigger reconnection even during graceful shutdown.

This fix ensures proper cleanup by setting status to OFFLINE before closing the websocket, clearing timers, and waking pending reconnection attempts. Also adds a guard in websocketClose to only reconnect if status is not OFFLINE.

Fixes #394

…ket#394)

Previously, destroy() would temporarily change status but the provider
would continue living, firing unwanted events and causing memory leaks.
The websocketClose handler would trigger reconnection even during
graceful shutdown.

This fix ensures proper cleanup by setting status to OFFLINE before
closing the websocket, clearing timers, and waking pending reconnection
attempts. Also adds a guard in websocketClose to only reconnect if
status is not OFFLINE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provider destroy function broken

1 participant